<template>
<!-- 查看个人信息页面 -->
  <div>
    <!-- 头部 -->
    <Title></Title>
    <!-- 内容 -->
    <div class="cont">
      <van-cell-group>
        <van-cell :value="loginName">
          <template slot="title">
            <van-icon name="manager-o" class="icon" color="#1989fa" size="20" />
            <span class="custom-title">账号</span>
          </template>
        </van-cell>
        <van-cell :value="phonenumber">
          <template slot="title">
            <van-icon name="phone-o" class="icon" color="#1989fa" size="20" />
            <span class="custom-title">手机号</span>
          </template>
        </van-cell>
        <van-cell :value="userName">
          <template slot="title">
            <van-icon name="smile-o" class="icon" color="#1989fa" size="20" />
            <span class="custom-title">昵称</span>
          </template>
        </van-cell>
      </van-cell-group>
    </div>
    <!-- 底部 -->
    <Botto></Botto>
  </div>
</template>
<script>
import Title from "../components/Title.vue";
import Botto from "../components/Bottom.vue";
import { Look } from "../api/User-api";
export default {
  created() {
    Look().then(res => {
      // if(res.cod ){
      // }
      console.log(res);
      if (res.code == 0) {
        this.loginName = res.data.loginName;
        this.phonenumber = res.data.phonenumber;
        this.userName = res.data.userName;
      }else {
        this.$notify({
          type:"danger",
          message:res.msg
        })
      }
    });
  },
  data() {
    return {
      loginName: "",
      phonenumber: "",
      userName: ""
    };
  },
  components: {
    Title,
    Botto
  }
};
</script>
<style lang="less" scoped>
.icon {
  margin-right: 5px;
}
</style>